//
//  SDHomeShowView.m
//  skinDetection
//
//  Created by  liangzhun on 2019/3/6.
//  Copyright © 2019年  liangzhun. All rights reserved.
//

#import "SDHomeShowView.h"

@implementation SDHomeShowView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
}

- (void)setViews
{
    self.hidden = YES;
    self.bottom.constant = self.bottom.constant + SDBottom_Height;
    CAGradientLayer *gl = [CAGradientLayer layer];
    gl.frame = CGRectMake(0, 0, SDMainScreenWidth, 400);
    gl.startPoint = CGPointMake(0, 0);
    gl.endPoint = CGPointMake(0, 0.4);
    gl.colors = @[(__bridge id)RGBA(255, 255, 255,0).CGColor,(__bridge id)SDWhiteColor.CGColor];
    gl.locations = @[@(0.0),@(1)];
    [self.GrandView.layer addSublayer:gl];

}
- (IBAction)goQuestionVC:(UIButton *)sender {
    if (self.questionBlock)self.questionBlock();
}

- (IBAction)goDeviceVC:(UIButton *)sender {
    if (self.deviceBlock)self.deviceBlock();
}

- (IBAction)closeView:(UIButton *)sender {
    [self dismissView];
}
/*显示选择框*/
- (void)showView
{
    self.hidden = NO;
    self.showBottom.constant = 0;
    [UIView animateWithDuration:0.5 animations:^{
        [self layoutIfNeeded];
    } completion:^(BOOL finished) {
        
    }];
    
}
/*隐藏选择框*/
- (void)dismissView
{
   self.showBottom.constant = -400;
    [UIView animateWithDuration:0.2 animations:^{
        [self layoutIfNeeded];
    } completion:^(BOOL finished) {
        self.hidden = YES;
    }];
}
@end
